package com.gjy.vm.jli;

import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.Instrumentation;

/**
 * jar cfvm my-agent.jar manifest.txt MyAgent.class
 *
 * @author 宫静雨
 * @version 1.0
 * @since 2023-06-02 11:51:23
 */
public class MyAgent {

    public static void premain(String agentArgs, Instrumentation inst) {
        // 创建自定义的ClassFileTransformer
        ClassFileTransformer transformer = new ClassFileTransformerImpl();

        // 注册ClassFileTransformer
        inst.addTransformer(transformer);
    }

}
